<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
	#app{
		max-width: 900px;
		margin: 0 auto;
	}
	</style>
</head>
<body>
	<div id="app">
		<section id="nice" data-tool="mdnice编辑器" data-website="https://www.mdnice.com" style="font-size: 16px; color: black; padding: 0 10px; line-height: 1.6; word-spacing: 0px; letter-spacing: 0px; word-break: break-word; word-wrap: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; margin-top: -10px;"><h1 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 24px;"><span class="prefix" style="display: none;"></span><span class="content">Git 常用命令及应用这一篇就够了（新手向）</span><span class="suffix"></span></h1>
<h2 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; border-bottom: 2px solid rgb(239, 112, 96); font-size: 1.3em;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: rgb(239, 112, 96); color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;">1.  git 常用命令</span><span class="suffix"></span><span style="display: inline-block; vertical-align: bottom; border-bottom: 36px solid #efebe9; border-right: 20px solid transparent;"> </span></h2>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">1.1   常用命令</span><span class="suffix" style="display: none;"></span></h3>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;初始化git</span><br>git&nbsp;init&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;克隆项目</span><br>git&nbsp;<span class="hljs-built_in" style="color: #4EC9B0; line-height: 26px;">clone</span>&nbsp;[url]&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;显示文件状态</span><br>git&nbsp;status&nbsp;-s&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;添加文件到暂存区</span><br>git&nbsp;add&nbsp;.&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#添加所有文件到暂存区</span><br>git&nbsp;add&nbsp;[文件名]&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#添加指定文件到暂存区</span><br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;提交暂存区到仓库区</span><br>git&nbsp;commit&nbsp;-m&nbsp;[提交信息]&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;拉取远程仓库的变化，更新本地分支</span><br>git&nbsp;pull&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;推送到远程仓库</span><br>git&nbsp;push&nbsp;<br>git&nbsp;push&nbsp;[远程主机名]&nbsp;[本地分支名]<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;更新所有的远程仓库信息</span><br>git&nbsp;fetch&nbsp;--all&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;合并指定分支到当前分支</span><br>git&nbsp;merge&nbsp;[分支名]&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;分支相关</span><br>git&nbsp;branch&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;列出所有本地分支</span><br>git&nbsp;checkout&nbsp;[分支名]&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;切换到指定分支</span><br>git&nbsp;checkout&nbsp;-b&nbsp;[本地分支名]&nbsp;origin/[远程分支名]&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;拉取远程分支</span><br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#查看项目中git配置</span><br>git&nbsp;config&nbsp;--list<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;配置全局信息</span><br>git&nbsp;config&nbsp;--global&nbsp;user.name&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"[name]"</span><br>git&nbsp;config&nbsp;--global&nbsp;user.email&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"[email&nbsp;address]"</span><br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;项目中配置</span><br>git&nbsp;config&nbsp;user.name&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"[name]"</span><br>git&nbsp;config&nbsp;user.email&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"[email&nbsp;address]"</span><br></code></pre>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">1.2  git remote</span><span class="suffix" style="display: none;"></span></h3>
<blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: rgb(239, 112, 96); background: #fff9f9;">
<p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0px; color: black; line-height: 26px;">管理远程仓库</p>
</blockquote>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#查看远程仓库</span><br>git&nbsp;remote&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#查看关联的远程仓库的详细信息</span><br>git&nbsp;remote&nbsp;-v&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#添加远程仓库的关联</span><br>git&nbsp;remote&nbsp;add&nbsp;origin&nbsp;[远程仓库地址]&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#删除远程仓库的关联</span><br>git&nbsp;remote&nbsp;remove&nbsp;[远程仓库名称]&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#更新远程仓库的分支</span><br>git&nbsp;remote&nbsp;update&nbsp;origin&nbsp;--prune&nbsp;<br></code></pre>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">1.3  git rebase</span><span class="suffix" style="display: none;"></span></h3>
<blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: rgb(239, 112, 96); background: #fff9f9;">
<p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0px; color: black; line-height: 26px;">rebase操作可以把本地未push的分叉提交历史整理成直线；</p>
<p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0px; color: black; line-height: 26px;">rebase的目的是使得我们在查看历史提交的变化时更容易，因为分叉的提交需要三方对比。</p>
<p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0px; color: black; line-height: 26px;">个人感觉非特定情况，还是不建议使用</p>
</blockquote>
<h2 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; border-bottom: 2px solid rgb(239, 112, 96); font-size: 1.3em;"><span class="prefix" style="display: none;"></span><span class="content" style="display: inline-block; font-weight: bold; background: rgb(239, 112, 96); color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;">2.  Git的常见应用</span><span class="suffix"></span><span style="display: inline-block; vertical-align: bottom; border-bottom: 36px solid #efebe9; border-right: 20px solid transparent;"> </span></h2>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">2.1  本地项目上传至多个远程库</span><span class="suffix" style="display: none;"></span></h3>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;添加关联远程库(这里以github和码云为例，大家替换掉仓库地址即可)</span><br>git&nbsp;remote&nbsp;add&nbsp;gitee&nbsp;[url]<br>git&nbsp;remote&nbsp;add&nbsp;gitee&nbsp;git@gitee.com:LuckRain/Knowledge-Sharing.git<br>git&nbsp;remote&nbsp;add&nbsp;github&nbsp;git@github.com:LuckRain7/Knowledge-Sharing.git<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;推送时分别将master分支推送到关联远程库</span><br>git&nbsp;push&nbsp;gitee&nbsp;master<br>git&nbsp;push&nbsp;github&nbsp;master<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;删除关联远程库</span><br>git&nbsp;remote&nbsp;rm&nbsp;[origin]&nbsp;<br></code></pre>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">2.2  Git 远程分支强制覆盖本地分支</span><span class="suffix" style="display: none;"></span></h3>
<blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: rgb(239, 112, 96); background: #fff9f9;">
<p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0px; color: black; line-height: 26px;">需在需要覆盖的分支上进行一下操作</p>
</blockquote>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;更新所有的远程仓库信息</span><br>git&nbsp;fetch&nbsp;--all&nbsp;&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;强制重置为&nbsp;origin/master（可以换成你需要的远程分支）&nbsp;远程分支</span><br>git&nbsp;reset&nbsp;--hard&nbsp;[origin/master]&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;拉取最新代码</span><br>git&nbsp;pull<br></code></pre>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">2.3  Git 配置忽略规则(.gitignore）不生效解决方案</span><span class="suffix" style="display: none;"></span></h3>
<blockquote data-tool="mdnice编辑器" style="display: block; font-size: 0.9em; overflow: auto; overflow-scrolling: touch; border-left: 3px solid rgba(0, 0, 0, 0.4); color: #6a737d; padding-top: 10px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; margin-bottom: 20px; margin-top: 20px; border-left-color: rgb(239, 112, 96); background: #fff9f9;">
<p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0px; color: black; line-height: 26px;">清除缓存 重新提交</p>
</blockquote>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;清除缓存</span><br>git&nbsp;rm&nbsp;-r&nbsp;--cached&nbsp;.<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;将所有文件添加到缓存区</span><br>git&nbsp;add&nbsp;.&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;添加提交信息</span><br>git&nbsp;commit&nbsp;-m&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">'update&nbsp;.gitignore'</span>&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;强制覆盖&nbsp;以远程分支&nbsp;rain&nbsp;为例</span><br>git&nbsp;push<br></code></pre>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">2.4  Git 强制提交本地分支覆盖远程分支</span><span class="suffix" style="display: none;"></span></h3>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;将所有文件添加到缓存区</span><br>git&nbsp;add&nbsp;.<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;添加提交信息</span><br>git&nbsp;commit&nbsp;-m&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">'更新信息'</span><br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;强制覆盖&nbsp;以远程分支&nbsp;rain&nbsp;为例</span><br>git&nbsp;push&nbsp;origin&nbsp;rain&nbsp;--force<br></code></pre>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">2.5 分支合并</span><span class="suffix" style="display: none;"></span></h3>
<h4 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;"><span class="prefix" style="display: none;"></span><span class="content">2.5.1  情景：</span><span class="suffix" style="display: none;"></span></h4>
<p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;">我现在的分支是 rain</p>
<p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;">我要把别人的分支 snow 合并到我的分支上来</p>
<h4 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;"><span class="prefix" style="display: none;"></span><span class="content">2.5.2  操作：</span><span class="suffix" style="display: none;"></span></h4>
<ol data-tool="mdnice编辑器" style="margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: decimal;">
<li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;">首先要进行切换分支（切换分支前要保证自己分支的内容都已经提交了）</section></li></ol>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;情况一:分支是本地分支(直接切换)</span><br>git&nbsp;branch&nbsp;snow&nbsp;&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;情况二:分支是远程分支(新建本地分支并与远程分支关联)</span><br>git&nbsp;checkout&nbsp;-b&nbsp;snow&nbsp;origin/snow<br></code></pre>
<ol start="2" data-tool="mdnice编辑器" style="margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: decimal;">
<li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;">在 snow 分支上拉取最新代码</section></li></ol>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;">git&nbsp;pull<br></code></pre>
<ol start="3" data-tool="mdnice编辑器" style="margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: decimal;">
<li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;">切换回我自己的分支rain</section></li></ol>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;">git&nbsp;branch&nbsp;rain&nbsp;&nbsp;<br></code></pre>
<ol start="4" data-tool="mdnice编辑器" style="margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: decimal;">
<li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;">执行合并</section></li></ol>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;">git&nbsp;merge&nbsp;rain&nbsp;<br></code></pre>
<ol start="5" data-tool="mdnice编辑器" style="margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: decimal;">
<li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;">处理代码冲突</section></li></ol>
<p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;">我这里比较喜欢使用 VS Code 的可视化界面解决代码冲突</p>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">2.6  版本回溯</span><span class="suffix" style="display: none;"></span></h3>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#版本回退到上一个版本</span><br>git&nbsp;reset&nbsp;--hard&nbsp;HEAD^&nbsp;<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;回溯到指定版本</span><br>git&nbsp;<span class="hljs-built_in" style="color: #4EC9B0; line-height: 26px;">log</span>&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#查看git历史版本信息，并找到指定版本的commit&nbsp;id</span><br>git&nbsp;reset&nbsp;--hard&nbsp;[commitId]&nbsp;&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;进行回溯</span><br></code></pre>
<figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px;"><img src="https://imgkr.cn-bj.ufileos.com/af67e5ef-aaba-41a1-8d08-05d5ba706513.png" alt="commitId" style="display: block; margin: 0 auto; max-width: 100%;"><figcaption style="margin-top: 5px; text-align: center; color: #888; font-size: 14px;">commitId</figcaption></figure>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">2.7  同时配置gitee&amp;github(多平台)ssh</span><span class="suffix" style="display: none;"></span></h3>
<h4 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;"><span class="prefix" style="display: none;"></span><span class="content">2.7.1.  本地创建多个ssh</span><span class="suffix" style="display: none;"></span></h4>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;进入.ssh目录</span><br><span class="hljs-built_in" style="color: #4EC9B0; line-height: 26px;">cd</span>&nbsp;~/.ssh<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;生成ssh</span><br>ssh-keygen&nbsp;-t&nbsp;rsa&nbsp;-C&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"xxxx@email.com"</span>&nbsp;-f&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"rain_github"</span>&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;后续绑定github平台</span><br>ssg-keygen&nbsp;-t&nbsp;rsa&nbsp;-C&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"xxxx@email.com"</span>&nbsp;-f&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"rain_gitee"</span>&nbsp;&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;后续绑定gitee平台</span><br>ssg-keygen&nbsp;-t&nbsp;rsa&nbsp;-C&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"xxxx@email.com"</span>&nbsp;-f&nbsp;<span class="hljs-string" style="color: #D69D85; line-height: 26px;">"coding_id_rsa"</span>&nbsp;&nbsp;<span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;后续绑定coding平台</span><br></code></pre>
<p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;">会在本地生成如下文件</p>
<figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px;"><img src="https://imgkr.cn-bj.ufileos.com/73ac375f-324f-4538-ae36-bd86315e21b9.png" alt="创建多个ssh" style="display: block; margin: 0 auto; max-width: 100%;"><figcaption style="margin-top: 5px; text-align: center; color: #888; font-size: 14px;">创建多个ssh</figcaption></figure>
<h4 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;"><span class="prefix" style="display: none;"></span><span class="content">2.7.2.  在各个平台进行ssh绑定</span><span class="suffix" style="display: none;"></span></h4>
<h5 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 16px;"><span class="prefix" style="display: none;"></span><span class="content">2.7.2.1  github平台操作</span><span class="suffix" style="display: none;"></span></h5>
<figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px;"><img src="https://imgkr.cn-bj.ufileos.com/30fb07a1-cd9a-4249-ac8c-3ef8b35077ab.png" alt="github" style="display: block; margin: 0 auto; max-width: 100%;"><figcaption style="margin-top: 5px; text-align: center; color: #888; font-size: 14px;">github</figcaption></figure>
<figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px;"><img src="https://imgkr.cn-bj.ufileos.com/b6106808-f584-4458-921f-19b4aedd9759.png" alt="githubaddssh" style="display: block; margin: 0 auto; max-width: 100%;"><figcaption style="margin-top: 5px; text-align: center; color: #888; font-size: 14px;">githubaddssh</figcaption></figure>
<h5 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 16px;"><span class="prefix" style="display: none;"></span><span class="content">2.7.2.2  gitee 平台操作</span><span class="suffix" style="display: none;"></span></h5>
<figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px;"><img src="https://imgkr.cn-bj.ufileos.com/8b443a21-8e99-4500-90b3-9e182a73ffd6.png" alt="gitee" style="display: block; margin: 0 auto; max-width: 100%;"><figcaption style="margin-top: 5px; text-align: center; color: #888; font-size: 14px;">gitee</figcaption></figure>
<h4 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;"><span class="prefix" style="display: none;"></span><span class="content">2.7.3.  解决ssh冲突配置</span><span class="suffix" style="display: none;"></span></h4>
<p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;">在 <code style="font-size: 14px; word-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0 2px; background-color: rgba(27,31,35,.05); font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: rgb(239, 112, 96);">C:\Users\ZHCZ\.ssh</code> 文件夹中新建 <code style="font-size: 14px; word-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0 2px; background-color: rgba(27,31,35,.05); font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; word-break: break-all; color: rgb(239, 112, 96);">config</code> 文件</p>
<p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;">进行如下配置</p>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;"><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;gitee</span><br>Host&nbsp;gitee.com<br>HostName&nbsp;gitee.com<br>PreferredAuthentications&nbsp;publickey<br>IdentityFile&nbsp;C:\Users\ZHCZ\.ssh\rain_gitee<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;github</span><br>Host&nbsp;github.com<br>HostName&nbsp;github.com<br>PreferredAuthentications&nbsp;publickey<br>IdentityFile&nbsp;C:\Users\ZHCZ\.ssh\rain_github<br><br><span class="hljs-comment" style="color: #57A64A; font-style: italic; line-height: 26px;">#&nbsp;coding</span><br>Host&nbsp;e.coding.net<br>HostName&nbsp;e.coding.net<br>PreferredAuthentications&nbsp;publickey<br>IdentityFile&nbsp;C:\Users\ZHCZ\.ssh\coding_id_rsa<br></code></pre>
<figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px;"><img src="https://imgkr.cn-bj.ufileos.com/67acd33c-d653-4eb7-93b5-01ca2e8d24a8.png" alt="config" style="display: block; margin: 0 auto; max-width: 100%;"><figcaption style="margin-top: 5px; text-align: center; color: #888; font-size: 14px;">config</figcaption></figure>
<h4 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 18px;"><span class="prefix" style="display: none;"></span><span class="content">2.7.4. 测试</span><span class="suffix" style="display: none;"></span></h4>
<pre class="custom" data-tool="mdnice编辑器" style="margin-top: 10px; margin-bottom: 10px; border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;"><span style="display: block; background: url(https://imgkr.cn-bj.ufileos.com/97e4eed2-a992-4976-acf0-ccb6fb34d308.png); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #1E1E1E; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;"></span><code class="hljs" style="overflow-x: auto; padding: 16px; color: #DCDCDC; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; font-size: 12px; -webkit-overflow-scrolling: touch; padding-top: 15px; background: #1E1E1E; border-radius: 5px;">ssh&nbsp;-T&nbsp;git@gitee.com<br>ssh&nbsp;-T&nbsp;git@github.com&nbsp;<br></code></pre>
<p data-tool="mdnice编辑器" style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;">返回success则表示设置成功</p>
<h3 data-tool="mdnice编辑器" style="margin-top: 30px; margin-bottom: 15px; font-weight: bold; color: black; font-size: 20px;"><span class="prefix" style="display: none;"></span><span class="content">推荐阅读</span><span class="suffix" style="display: none;"></span></h3>
<ul data-tool="mdnice编辑器" style="margin-top: 8px; margin-bottom: 8px; padding-left: 25px; color: black; list-style-type: disc;">
<li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;"><p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;"><a href="https://mp.weixin.qq.com/s/9wl8-SYspr3s358Tf0CmSg" style="text-decoration: none; word-wrap: break-word; font-weight: bold; color: rgb(239, 112, 96); border-bottom: 1px solid rgb(239, 112, 96);">在 Array.reduce 中正确使用 async</a></p>
</section></li><li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;"><p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;"><a href="https://mp.weixin.qq.com/s/OtFsaLb2a26D0Uz4aFaoAw" style="text-decoration: none; word-wrap: break-word; font-weight: bold; color: rgb(239, 112, 96); border-bottom: 1px solid rgb(239, 112, 96);">如何在 Array.filter 中正确使用 Async</a></p>
</section></li><li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;"><p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;"><a href="https://mp.weixin.qq.com/s/39J2KO8h_cBKg3MWB63L7w" style="text-decoration: none; word-wrap: break-word; font-weight: bold; color: rgb(239, 112, 96); border-bottom: 1px solid rgb(239, 112, 96);">如何在 Array.forEach 中正确使用 Async</a></p>
</section></li><li><section style="margin-top: 5px; margin-bottom: 5px; line-height: 26px; text-align: left; color: rgb(1,1,1); font-weight: 500;"><p style="font-size: 16px; padding-top: 8px; padding-bottom: 8px; margin: 0; line-height: 26px; color: black;"><a href="https://mp.weixin.qq.com/s/mFmqyicyfaAOdxmhlPmSRQ" style="text-decoration: none; word-wrap: break-word; font-weight: bold; color: rgb(239, 112, 96); border-bottom: 1px solid rgb(239, 112, 96);">如何在 Vue中优雅的使用防抖节流</a></p>
</section></li></ul>
<figure data-tool="mdnice编辑器" style="margin: 0; margin-top: 10px; margin-bottom: 10px;"><img src="https://imgkr.cn-bj.ufileos.com/ddfea194-6851-4fd2-b073-6fec18194ab0.png" alt="您的关注是莫大的鼓励 ❤" style="display: block; margin: 0 auto; max-width: 100%;"><figcaption style="margin-top: 5px; text-align: center; color: #888; font-size: 14px;">您的关注是莫大的鼓励 ❤</figcaption></figure>
</section>
	</div>
</body>
</html>